const express = require('express')
const app = express()

app.get('/qq', (req, res) => {
	const callback = req.query.callback
	res.send('我是一个qq-----我是qq')
})

app.get('/wyy', (req, res) => {
	const callback = req.query.callback
	res.send('我是一个wyy')
})

app.get('/jsonp', (req, res) => {
	const callback = req.query.callback
	const obj = {
		id: 1,
		name: 'jack',
		age: 18
	}
	res.send(callback + '(' + JSON.stringify(obj) + ')') //  callback(123)
})

app.get('/jsonp2', (req, res) => {
	const obj = {
		id: 1,
		name: 'jack',
		age: 18
	}
	res.jsonp(obj)
})
app.listen(3000, '192.168.75.106', () => {
	console.log('http://192.168.75.106:3000');
})
